home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / SCSL / scfftm.z / scfftm
Encoding:
Text File  |  2002-10-03  |  38.3 KB  |  793 lines

  1.  
  2.  
  3.  
  4. SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))                                                          SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      SSSSCCCCFFFFFFFFTTTTMMMM, DDDDZZZZFFFFFFFFTTTTMMMM, CCCCSSSSFFFFFFFFTTTTMMMM, ZZZZDDDDFFFFFFFFTTTTMMMM - Applies multiple real-to-complex or
  10.      complex-to-real Fast Fourier Transforms (FFTs)
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      Single precision -> Single precision complex
  14.  
  15.           Fortran:
  16.                CCCCAAAALLLLLLLL SSSSCCCCFFFFFFFFTTTTMMMM ((((_i_s_i_g_n,,,, _n,,,, _l_o_t,,,, _s_c_a_l_e,,,, _x,,,, _l_d_x,,,, _y,,,, _l_d_y,,,, _t_a_b_l_e,,,, _w_o_r_k,,,,
  17.                _i_s_y_s))))
  18.  
  19.           C/C++:
  20.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  21.                iiiinnnntttt ssssccccffffffffttttmmmm ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, iiiinnnntttt _l_o_t,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,, ffffllllooooaaaatttt *_x,,,,
  22.                iiiinnnntttt _l_d_x,,,, ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_y,,,, iiiinnnntttt _l_d_y,,,, ffffllllooooaaaatttt *_t_a_b_l_e,,,, ffffllllooooaaaatttt *_w_o_r_k,,,,
  23.                iiiinnnntttt *_i_s_y_s))));;;;
  24.  
  25.           C++ STL:
  26.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  27.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  28.                iiiinnnntttt ssssccccffffffffttttmmmm ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, iiiinnnntttt _l_o_t,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,, ffffllllooooaaaatttt *_x,,,,
  29.                iiiinnnntttt _l_d_x,,,, ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_y,,,, iiiinnnntttt _l_d_y,,,, ffffllllooooaaaatttt *_t_a_b_l_e,,,, ffffllllooooaaaatttt *_w_o_r_k,,,,
  30.                iiiinnnntttt *_i_s_y_s))));;;;
  31.  
  32.      Double precision -> Double precision complex
  33.  
  34.           Fortran:
  35.                CCCCAAAALLLLLLLL DDDDZZZZFFFFFFFFTTTTMMMM ((((_i_s_i_g_n,,,, _n,,,, _l_o_t,,,, _s_c_a_l_e,,,, _x,,,, _l_d_x,,,, _y,,,, _l_d_y,,,, _t_a_b_l_e,,,, _w_o_r_k,,,,
  36.                _i_s_y_s))))
  37.  
  38.           C/C++:
  39.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  40.                iiiinnnntttt ddddzzzzffffffffttttmmmm ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, iiiinnnntttt _l_o_t,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,, ddddoooouuuubbbblllleeee *_x,,,,
  41.                iiiinnnntttt _l_d_x,,,, ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_y,,,, iiiinnnntttt _l_d_y,,,, ddddoooouuuubbbblllleeee *_t_a_b_l_e,,,, ddddoooouuuubbbblllleeee *_w_o_r_k,,,,
  42.                iiiinnnntttt *_i_s_y_s))));;;;
  43.  
  44.           C++ STL:
  45.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  46.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  47.                iiiinnnntttt ddddzzzzffffffffttttmmmm ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, iiiinnnntttt _l_o_t,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,, ddddoooouuuubbbblllleeee *_x,,,,
  48.                iiiinnnntttt _l_d_x,,,, ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_y,,,, iiiinnnntttt _l_d_y,,,, ddddoooouuuubbbblllleeee *_t_a_b_l_e,,,, ddddoooouuuubbbblllleeee
  49.                *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  50.  
  51.      Single precision complex -> Single precision
  52.  
  53.           Fortran:
  54.                CCCCAAAALLLLLLLL CCCCSSSSFFFFFFFFTTTTMMMM ((((_i_s_i_g_n,,,, _n,,,, _l_o_t,,,, _s_c_a_l_e,,,, _x,,,, _l_d_x,,,, _y,,,, _l_d_y,,,, _t_a_b_l_e,,,, _w_o_r_k,,,,
  55.                _i_s_y_s))))
  56.  
  57.           C/C++:
  58.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  59.                iiiinnnntttt ccccssssffffffffttttmmmm ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, iiiinnnntttt _l_o_t,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,,
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))                                                          SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))
  71.  
  72.  
  73.  
  74.                ssssccccssssllll____ccccoooommmmpppplllleeeexxxx *_x,,,, iiiinnnntttt _l_d_x,,,, ffffllllooooaaaatttt *_y,,,, iiiinnnntttt _l_d_y,,,, ffffllllooooaaaatttt *_t_a_b_l_e,,,,
  75.                ffffllllooooaaaatttt *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  76.  
  77.           C++ STL:
  78.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  79.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  80.                iiiinnnntttt ccccssssffffffffttttmmmm ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, iiiinnnntttt _l_o_t,,,, ffffllllooooaaaatttt _s_c_a_l_e,,,,
  81.                ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>> *_x,,,, iiiinnnntttt _l_d_x,,,, ffffllllooooaaaatttt *_y,,,, iiiinnnntttt _l_d_y,,,, ffffllllooooaaaatttt *_t_a_b_l_e,,,,
  82.                ffffllllooooaaaatttt *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  83.  
  84.      Double precision complex -> Double precision
  85.  
  86.           Fortran:
  87.                CCCCAAAALLLLLLLL ZZZZDDDDFFFFFFFFTTTTMMMM ((((_i_s_i_g_n,,,, _n,,,, _l_o_t,,,, _s_c_a_l_e,,,, _x,,,, _l_d_x,,,, _y,,,, _l_d_y,,,, _t_a_b_l_e,,,, _w_o_r_k,,,,
  88.                _i_s_y_s))))
  89.  
  90.           C/C++:
  91.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  92.                iiiinnnntttt zzzzddddffffffffttttmmmm ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, iiiinnnntttt _l_o_t,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,,
  93.                ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx *_x,,,, iiiinnnntttt _l_d_x,,,, ddddoooouuuubbbblllleeee *_y,,,, iiiinnnntttt _l_d_y,,,, ddddoooouuuubbbblllleeee *_t_a_b_l_e,,,,
  94.                ddddoooouuuubbbblllleeee *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  95.  
  96.           C++ STL:
  97.                ####iiiinnnncccclllluuuuddddeeee <<<<ccccoooommmmpppplllleeeexxxx....hhhh>>>>
  98.                ####iiiinnnncccclllluuuuddddeeee <<<<ssssccccssssllll____fffffffftttt....hhhh>>>>
  99.                iiiinnnntttt zzzzddddffffffffttttmmmm ((((iiiinnnntttt _i_s_i_g_n,,,, iiiinnnntttt _n,,,, iiiinnnntttt _l_o_t,,,, ddddoooouuuubbbblllleeee _s_c_a_l_e,,,,
  100.                ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>> *_x,,,, iiiinnnntttt _l_d_x,,,, ddddoooouuuubbbblllleeee *_y,,,, iiiinnnntttt _l_d_y,,,, ddddoooouuuubbbblllleeee *_t_a_b_l_e,,,,
  101.                ddddoooouuuubbbblllleeee *_w_o_r_k,,,, iiiinnnntttt *_i_s_y_s))));;;;
  102.  
  103. IIIIMMMMPPPPLLLLEEEEMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  104.      These routines are part of the SCSL Scientific Library and can be loaded
  105.      using either the ----llllssssccccssss or the ----llllssssccccssss____mmmmpppp option.  The ----llllssssccccssss____mmmmpppp option
  106.      directs the linker to use the multi-processor version of the library.
  107.  
  108.      When linking to SCSL with ----llllssssccccssss or ----llllssssccccssss____mmmmpppp, the default integer size is
  109.      4 bytes (32 bits). Another version of SCSL is available in which integers
  110.      are 8 bytes (64 bits).  This version allows the user access to larger
  111.      memory sizes and helps when porting legacy Cray codes.  It can be loaded
  112.      by using the ----llllssssccccssss____iiii8888 option or the ----llllssssccccssss____iiii8888____mmmmpppp option. A program may use
  113.      only one of the two versions; 4-byte integer and 8-byte integer library
  114.      calls cannot be mixed.
  115.  
  116.      The C and C++ prototypes shown above are appropriate for the 4-byte
  117.      integer version of SCSL. When using the 8-byte integer version, the
  118.      variables of type iiiinnnntttt become lllloooonnnngggg lllloooonnnngggg and the <<<<ssssccccssssllll____fffffffftttt____iiii8888....hhhh>>>> header
  119.      file should be included.
  120.  
  121. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  122.      SSSSCCCCFFFFFFFFTTTTMMMM/DDDDZZZZFFFFFFFFTTTTMMMM computes the FFT of each column of the real matrix _X, and
  123.      it stores the results in the corresponding column of the complex matrix
  124.      _Y.  CCCCSSSSFFFFFFFFTTTTMMMM/ZZZZDDDDFFFFFFFFTTTTMMMM computes the corresponding inverse transforms.
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))                                                          SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))
  137.  
  138.  
  139.  
  140.      In FFT applications, it is customary to use zero-based subscripts; the
  141.      formulas are simpler that way.  First, the function of SSSSCCCCFFFFFFFFTTTTMMMM is
  142.      described.  Suppose that the arrays are declared as follows:
  143.  
  144.           Fortran:
  145.  
  146.                REAL    X(0:ldx-1, 0:lot-1)
  147.                COMPLEX Y(0:ldy-1, 0:lot-1)
  148.  
  149.  
  150.           C/C++:
  151.  
  152.                float x[lot][ldx];
  153.                scsl_complex y[lot][ldy];
  154.  
  155.  
  156.           C++ STL:
  157.  
  158.                float x[lot][ldx];
  159.                complex<float> y[lot][ldy];
  160.  
  161.  
  162.      where _l_d_x >= _n, _l_d_y >= _n/2 + 1.
  163.  
  164.      Then column _L of the output array is the FFT of column _L of the input
  165.      array, using the following formula for the FFT:
  166.  
  167.                              n-1
  168.           Y(k, L) = scale *  Sum  [ X(j, L)*w**(isign*j*k) ]
  169.                              j=0
  170.  
  171.  
  172.      for _k = 0, ..., _n/2
  173.          _L = 0, ..., _l_o_t-1
  174.  
  175.      where:
  176.  
  177.           _w         =exp(2*_p_i*_i/_n),
  178.  
  179.           _i         = + sqrt(-1)
  180.  
  181.           _p_i        = 3.14159...,
  182.  
  183.           _i_s_i_g_n     = +1 or -1,
  184.  
  185.           _l_o_t       = the number of columns to transform
  186.  
  187.      Different authors use different conventions for which transform
  188.      (_i_s_i_g_n = +1 or _i_s_i_g_n = -1) is used in the real-to-complex case, and what
  189.      the _s_c_a_l_e factor should be.  Some adopt the convention that _i_s_i_g_n = 1 for
  190.      the real-to-complex transform, and _i_s_i_g_n = -1 for the complex-to-real
  191.      inverse.  Others use the opposite convention.  You can make these
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))                                                          SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))
  203.  
  204.  
  205.  
  206.      routines compute any of the various possible definitions, however, by
  207.      choosing the appropriate values for _i_s_i_g_n and _s_c_a_l_e.
  208.  
  209.      The relevant fact from FFT theory is this:  If you use SSSSCCCCFFFFFFFFTTTTMMMM to take the
  210.      real-to-complex FFT, using any particular values of _i_s_i_g_n and _s_c_a_l_e, the
  211.      mathematical inverse function is computed by using CCCCSSSSFFFFFFFFTTTTMMMM with -_i_s_i_g_n and
  212.      1/(_n*_s_c_a_l_e).  In particular, if you call SSSSCCCCFFFFFFFFTTTTMMMM with _i_s_i_g_n = +1 and _s_c_a_l_e
  213.      = 1.0, you can use CCCCSSSSFFFFFFFFTTTTMMMM to compute the inverse complex-to-real FFT by
  214.      using _i_s_i_g_n = -1 and _s_c_a_l_e = 1.0/_n.
  215.  
  216.      See the NOTES section of this man page for information about the
  217.      interpretation of the data types described in the following arguments.
  218.  
  219.      These routines have the following arguments:
  220.  
  221.      _i_s_i_g_n     Integer.  (input)
  222.                Specifies whether to initialize the _t_a_b_l_e array or do the
  223.                forward or inverse Fourier transform, as follows:
  224.  
  225.                If _i_s_i_g_n = 0, the routine initializes _t_a_b_l_e and returns.  In
  226.                this case, the only arguments used or checked are _i_s_i_g_n, _n, and
  227.                _t_a_b_l_e.
  228.  
  229.                If _i_s_i_g_n = +1 or -1, the value of _i_s_i_g_n is the sign of the
  230.                exponent used in the FFT formula.
  231.  
  232.      _n         Integer.  (input)
  233.                Size of the transforms (the number of elements in each column
  234.                of the input matrix to be transformed).  If _n is not positive,
  235.                SSSSCCCCFFFFFFFFTTTTMMMM or CCCCSSSSFFFFFFFFTTTTMMMM returns without computing a transform.
  236.  
  237.      _l_o_t       Integer.  (input)
  238.                The number of transforms to be computed (or "lot size").  This
  239.                is the number of elements in each row of the input and output
  240.                matrix.  If _l_o_t is not positive, the routine returns without
  241.                computing a transform.
  242.  
  243.      _s_c_a_l_e     Scale factor. (input)
  244.                SSSSCCCCFFFFFFFFTTTTMMMM: Single precision.
  245.                DDDDZZZZFFFFFFFFTTTTMMMM: Double precision.
  246.                CCCCSSSSFFFFFFFFTTTTMMMM: Single precision.
  247.                ZZZZDDDDFFFFFFFFTTTTMMMM: Double precision.
  248.                Each element of the output array is multiplied by _s_c_a_l_e after
  249.                taking the transform, as defined in the preceding formula.
  250.  
  251.      _x         Array of dimensions (_l_d_x, _l_o_t).  (input)
  252.                SSSSCCCCFFFFFFFFTTTTMMMM: Single precision array.
  253.                DDDDZZZZFFFFFFFFTTTTMMMM: Double precision array.
  254.                CCCCSSSSFFFFFFFFTTTTMMMM: Single precision complex array.
  255.                ZZZZDDDDFFFFFFFFTTTTMMMM: Double precision complex array.
  256.                Input array of values to be transformed.
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))                                                          SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))
  269.  
  270.  
  271.  
  272.      _l_d_x       Integer.  (input)
  273.                The number of rows in the _x array, as it was declared in the
  274.                calling program (the leading dimension of _x).
  275.                SSSSCCCCFFFFFFFFTTTTMMMM, DDDDZZZZFFFFFFFFTTTTMMMM:  _l_d_x >= MMMMAAAAXXXX(_n, 1).
  276.                CCCCSSSSFFFFFFFFTTTTMMMM, ZZZZDDDDFFFFFFFFTTTTMMMM:  _l_d_x >= MMMMAAAAXXXX(_n/2 + 1, 1).
  277.  
  278.      _y         Array of dimensions (_l_d_y, _l_o_t).  (input or output)
  279.                SSSSCCCCFFFFFFFFTTTTMMMM: Single precision complex array.
  280.                DDDDZZZZFFFFFFFFTTTTMMMM: Double precision complex array.
  281.                CCCCSSSSFFFFFFFFTTTTMMMM: Single precision array.
  282.                ZZZZDDDDFFFFFFFFTTTTMMMM: Double precision array.
  283.  
  284.                Output array of transformed values.  Each column of the output
  285.                array, _y, is the FFT of the corresponding column of the input
  286.                array, _x, computed according to the preceding formula.
  287.  
  288.                The output array may be equivalenced to the input array. In
  289.                that case, the transform is done in place and the input array
  290.                is overwritten with the transformed values. In this case, the
  291.                following conditions on the leading dimensions must hold:
  292.  
  293.                SSSSCCCCFFFFFFFFTTTTMMMM, DDDDZZZZFFFFFFFFTTTTMMMM:  _l_d_x = 2_l_d_y.
  294.                CCCCSSSSFFFFFFFFTTTTMMMM, ZZZZDDDDFFFFFFFFTTTTMMMM:  _l_d_y = 2_l_d_x.
  295.  
  296.      _l_d_y       Integer.  (input)
  297.                Number of rows in the _y array, as declared in the calling
  298.                program (the leading dimension of _y).
  299.                SSSSCCCCFFFFFFFFTTTTMMMM, DDDDZZZZFFFFFFFFTTTTMMMM:  _l_d_y >= MMMMAAAAXXXX(_n/2 + 1, 1).
  300.                CCCCSSSSFFFFFFFFTTTTMMMM, ZZZZDDDDFFFFFFFFTTTTMMMM:  _l_d_y >= MMMMAAAAXXXX(_n, 1).
  301.  
  302.      _t_a_b_l_e     Array of dimension (_n + _N_F_R) (input or output)
  303.                SSSSCCCCFFFFFFFFTTTTMMMM, CCCCSSSSFFFFFFFFTTTTMMMM: Single precision array.
  304.                DDDDZZZZFFFFFFFFTTTTMMMM, ZZZZDDDDFFFFFFFFTTTTMMMM: Double precision array.
  305.                Table of factors and roots of unity.  See the description of
  306.                the _i_s_y_s argument for the value of _N_F_R.
  307.  
  308.                If _i_s_i_g_n = 0, the routine initializes _t_a_b_l_e (_t_a_b_l_e is output
  309.                only).
  310.  
  311.                If _i_s_i_g_n = +1 or -1, the values in _t_a_b_l_e are assumed to be
  312.                initialized already by a prior call with _i_s_i_g_n = 0 (_t_a_b_l_e is
  313.                input only).
  314.  
  315.      _w_o_r_k      Array of dimension _n + 2
  316.                SSSSCCCCFFFFFFFFTTTTMMMM, CCCCSSSSFFFFFFFFTTTTMMMM: Single precision array.
  317.                DDDDZZZZFFFFFFFFTTTTMMMM, ZZZZDDDDFFFFFFFFTTTTMMMM: Double precision array.
  318.                Work array used for intermediate calculations.  Its address
  319.                space must be different from that of the input and output
  320.                arrays.
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))                                                          SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))
  335.  
  336.  
  337.  
  338.      _i_s_y_s      Integer array dimensioned 0000........_i_s_y_s((((0000)))).
  339.                An array that gives implementation-specific information.  All
  340.                features and functions of the FFT routines specific to any
  341.                particular implementation are confined to this _i_s_y_s array.
  342.  
  343.                In the Origin series implementation, _i_s_y_s((((0000))))====0000 and _i_s_y_s((((0000))))====1111
  344.                are supported.  In SCSL versions prior to 1.3, only _i_s_y_s((((0000))))====0000
  345.                was allowed. For _i_s_y_s((((0000))))====0000, _N_F_R====11115555, and for _i_s_y_s((((0000))))====1111, _N_F_R====222255556666.
  346.                The _N_F_R words of storage in the _t_a_b_l_e array contain a
  347.                factorization of the length of the transform.
  348.  
  349.                The smaller value of _N_F_R for _i_s_y_s((((0000))))====0000 is historical. It is too
  350.                small to store all the required factors for the highest
  351.                performing FFT, so when _i_s_y_s((((0000))))====0000, extra space is allocated
  352.                when the _t_a_b_l_e array is initialized. To avoid memory leaks,
  353.                this extra space must be deallocated when the _t_a_b_l_e array is no
  354.                longer needed. The SSSSCCCCFFFFFFFFTTTTMMMMFFFF routine is used to release this
  355.                memory. Due to the potential for memory leaks, the use of
  356.                _i_s_y_s((((0000))))====0000 should be avoided.
  357.  
  358.                For _i_s_y_s((((0000))))====1111, the value of _N_F_R is large enough so that no
  359.                extra memory needs to be allocated, and there is no need to
  360.                call SSSSCCCCFFFFFFFFTTTTMMMMFFFF to release memory. If called, it does nothing.
  361.  
  362.                NOTE: _i_s_y_s((((0000))))====1111 means that _i_s_y_s is an integer array with two
  363.                elements. The second element, _i_s_y_s((((1111)))), will not be accessed.
  364.  
  365. NNNNOOOOTTTTEEEESSSS
  366.      The following data types are described in this documentation:
  367.  
  368.           TTTTeeeerrrrmmmm UUUUsssseeeedddd                     DDDDaaaattttaaaa ttttyyyyppppeeee
  369.  
  370.      Fortran:
  371.  
  372.           Array dimensioned 0000........_n----1111      xxxx((((0000::::nnnn----1111))))
  373.  
  374.           Array of dimensions (_m,_n)     xxxx((((mmmm,,,,nnnn))))
  375.  
  376.           Array of dimensions (_m,_n,_p)   xxxx((((mmmm,,,,nnnn,,,,pppp))))
  377.  
  378.           Integer                       IIIINNNNTTTTEEEEGGGGEEEERRRR (IIIINNNNTTTTEEEEGGGGEEEERRRR****8888 for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  379.  
  380.           Single precision              RRRREEEEAAAALLLL
  381.  
  382.           Double precision              DDDDOOOOUUUUBBBBLLLLEEEE PPPPRRRREEEECCCCIIIISSSSIIIIOOOONNNN
  383.  
  384.           Single precision complex      CCCCOOOOMMMMPPPPLLLLEEEEXXXX
  385.  
  386.           Double precision complex      DDDDOOOOUUUUBBBBLLLLEEEE CCCCOOOOMMMMPPPPLLLLEEEEXXXX
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))                                                          SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))
  401.  
  402.  
  403.  
  404.      C/C++:
  405.  
  406.           Array dimensioned 0000........_n----1111      xxxx[[[[_n]]]]
  407.  
  408.           Array of dimensions (_m,_n)     xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]]
  409.  
  410.           Array of dimensions (_m,_n,_p)   xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]]
  411.  
  412.           Integer                       iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  413.  
  414.           Single precision              ffffllllooooaaaatttt
  415.  
  416.           Double precision              ddddoooouuuubbbblllleeee
  417.  
  418.           Single precision complex      ssssccccssssllll____ccccoooommmmpppplllleeeexxxx
  419.  
  420.           Double precision complex      ssssccccssssllll____zzzzoooommmmpppplllleeeexxxx
  421.  
  422.      C++ STL:
  423.  
  424.           Array dimensioned 0000........_n----1111      xxxx[[[[_n]]]]
  425.  
  426.           Array of dimensions (_m,_n)     xxxx[[[[mmmm****nnnn]]]] oooorrrr xxxx[[[[nnnn]]]][[[[mmmm]]]]
  427.  
  428.           Array of dimensions (_m,_n,_p)   xxxx[[[[mmmm****nnnn****pppp]]]] oooorrrr xxxx[[[[pppp]]]][[[[nnnn]]]][[[[mmmm]]]]
  429.  
  430.           Integer                       iiiinnnntttt (lllloooonnnngggg lllloooonnnngggg for ----llllssssccccssss____iiii8888[[[[____mmmmpppp]]]])
  431.  
  432.           Single precision              ffffllllooooaaaatttt
  433.  
  434.           Double precision              ddddoooouuuubbbblllleeee
  435.  
  436.           Single precision complex      ccccoooommmmpppplllleeeexxxx<<<<ffffllllooooaaaatttt>>>>
  437.  
  438.           Double precision complex      ccccoooommmmpppplllleeeexxxx<<<<ddddoooouuuubbbblllleeee>>>>
  439.  
  440. CCCCAAAAUUUUTTTTIIIIOOOONNNNSSSS
  441.      Transform sizes with a prime factor exceeding 22223332222----1111 are not supported for
  442.      the 8-byte integer version of the library.
  443.  
  444.      In addition to the _w_o_r_k array, the FFT routines also dynamically allocate
  445.      scratch space from the stack. The amount of space allocated can be
  446.      slightly bigger than the size of the largest processor cache. For single
  447.      processor runs, the default stack size is large enough that these
  448.      allocations generally cause no problems. But for parallel runs, you need
  449.      to ensure that the stack size of slave threads is big enough to hold this
  450.      scratch space. Failure to reserve sufficient stack space will cause
  451.      programs to dump core due to stack overflows.  The stack size of MP
  452.      library slave threads is controlled via the MMMMPPPP____SSSSLLLLAAAAVVVVEEEE____SSSSTTTTAAAACCCCKKKKSSSSIIIIZZZZEEEE
  453.      environment variable or the mmmmpppp____sssseeeetttt____ssssllllaaaavvvveeee____ssssttttaaaacccckkkkssssiiiizzzzeeee(((()))) library routine. See
  454.      the mmmmpppp(3C), mmmmpppp(3F) and ppppeeee____eeeennnnvvvviiiirrrroooonnnn(5) reference pages for more information
  455.      on controlling the slave stack size. For pthreads applications, the
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))                                                          SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))
  467.  
  468.  
  469.  
  470.      thread's stack size is specified as one of many creation attributes
  471.      provided in the pthread_attr_t argument to pppptttthhhhrrrreeeeaaaadddd____ccccrrrreeeeaaaatttteeee(3P).  The
  472.      stacksize attribute should be set explicitly to a non-default value using
  473.      the pppptttthhhhrrrreeeeaaaadddd____aaaattttttttrrrr____sssseeeettttssssttttaaaacccckkkkssssiiiizzzzeeee(3P) call, described in the
  474.      pppptttthhhhrrrreeeeaaaadddd____aaaattttttttrrrr____iiiinnnniiiitttt(3P) man page.
  475.  
  476.      Care must be exercised if copies of the _t_a_b_l_e array are used: even though
  477.      a copy exists, the original must persist. As an example, the following
  478.      code will nnnnooootttt work:
  479.  
  480.           #include <scsl_fft.h>
  481.           float x[56][129];
  482.           scsl_complex y[56][65];
  483.           float table[128 + 256];
  484.           float work[128+2];
  485.           int isys[2];
  486.           isys[0] = 1;
  487.           {
  488.             float table_orig[128+256];
  489.  
  490.             scfftm(0, 128, 50, 1.0f, (float *) x, 129,
  491.                   (scsl_complex *) y, 65, table_orig, work, isys);
  492.             bcopy(table_orig, table, (128+256)*sizeof(float));
  493.           }
  494.           scfftm(1, 128, 50, 1.0f, (float *) x, 129,
  495.                  (scsl_complex *) y, 65, table, work, isys);
  496.  
  497.  
  498.      In this example, because _t_a_b_l_e__o_r_i_g is a stack variable that does not
  499.      persist outside of the code block delimited by the braces, the data in
  500.      the copy, _t_a_b_l_e, are not guaranteed to be valid. However, the following
  501.      code will work because _t_a_b_l_e__o_r_i_g is persistent:
  502.  
  503.           #include <scsl_fft.h>
  504.           float x[56][129];
  505.           scsl_complex y[56][65];
  506.           float table_orig[128+256];
  507.           float table[128 + 256];
  508.           float work[128+2];
  509.           int isys[2];
  510.           isys[0] = 1;
  511.           scfftm(0, 128, 50, 1.0f, (float *) x, 129,
  512.                 (scsl_complex *) y, 65, table_orig, work, isys);
  513.           bcopy(table_orig, table, (128+256)*sizeof(float));
  514.           scfftm(1, 128, 50, 1.0f, (float *) x, 129,
  515.                 (scsl_complex *) y, 65, table, work, isys);
  516.  
  517.  
  518. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  519.      These examples use the table and workspace sizes appropriate to the
  520.      Origin series.
  521.  
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))                                                          SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))
  533.  
  534.  
  535.  
  536.      Example 1:  Initialize the TTTTAAAABBBBLLLLEEEE array in preparation for doing an FFT of
  537.      size 128.  In this case only the _i_s_i_g_n, _n, and _t_a_b_l_e arguments are used;
  538.      you may use dummy arguments or zeros for the other arguments in the
  539.      subroutine call.
  540.  
  541.      Fortran:
  542.  
  543.            REAL TABLE(128 + 256)
  544.            INTEGER ISYS(0:1)
  545.            ISYS(0) = 1
  546.            CALL SCFFTM(0, 128, 1, 0.0, DUMMY, 1, DUMMY, 1,
  547.           &            TABLE, DUMMY, ISYS)
  548.  
  549.  
  550.      C/C++:
  551.  
  552.      #include <scsl_fft.h>
  553.      float table[128 + 256];
  554.      int isys[2];
  555.      isys[0] = 1;
  556.      scfftm(0, 128, 0, 0.0f, NULL, 1, NULL, 1, table, NULL, isys);
  557.  
  558.  
  559.      C++ STL:
  560.  
  561.      #include <complex.h>
  562.      #include <scsl_fft.h>
  563.      float table[128 + 256];
  564.      int isys[2];
  565.      isys[0] = 1;
  566.      scfftm(0, 128, 0, 0.0f, NULL, 1, NULL, 1, table, NULL, isys);
  567.  
  568.  
  569.      Example 2:  XXXX is a real array of dimension (0...128, 0...55), and YYYY is a
  570.      complex array of dimension (0...64, 0...55).  The first 128 elements in
  571.      each column of XXXX contain data; the extra element forces an odd leading
  572.      dimension.  Take the FFT of the first 50 columns of XXXX and store the
  573.      results in the first 50 columns of YYYY.  Before taking the FFT, initialize
  574.      the TTTTAAAABBBBLLLLEEEE array, as in example 1.
  575.  
  576.      Fortran:
  577.  
  578.      REAL    X(0:128, 0:55)
  579.      COMPLEX Y(0:64,  0:55)
  580.      REAL    TABLE(128 + 256)
  581.      REAL    WORK(128+2)
  582.      INTEGER ISYS(0:1)
  583.      ISYS(0) = 1
  584.      CALL SCFFTM(0, 128, 50, 1.0, X, 129, Y, 65, TABLE, WORK, ISYS)
  585.      CALL SCFFTM(1, 128, 50, 1.0, X, 129, Y, 65, TABLE, WORK, ISYS)
  586.  
  587.  
  588.  
  589.  
  590.  
  591.                                                                         PPPPaaaaggggeeee 9999
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))                                                          SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))
  599.  
  600.  
  601.  
  602.      C/C++:
  603.  
  604.           #include <scsl_fft.h>
  605.           float x[56][129];
  606.           scsl_complex y[56][65];
  607.           float table[128 + 256];
  608.           float work[128+2];
  609.           int isys[2];
  610.           isys[0] = 1;
  611.           scfftm(0, 128, 50, 1.0f, (float *) x, 129,
  612.                 (scsl_complex *) y, 65, table, work, isys);
  613.           scfftm(1, 128, 50, 1.0f, (float *) x, 129,
  614.                 (scsl_complex *) y, 65, table, work, isys);
  615.  
  616.  
  617.      C++ STL:
  618.  
  619.           #include <complex.h>
  620.           #include <scsl_fft.h>
  621.           float x[56][129];
  622.           complex<float> y[56][65];
  623.           float table[128 + 256
  624.           int isys[2];
  625.           isys[0] = 1;
  626.           scfftm(0, 128, 50, 1.0f, (float *) x, 129,
  627.                 (complex<float> *) y, 65, table, work, isys);
  628.           scfftm(1, 128, 50, 1.0f, (float *) x, 129,
  629.                 (complex<float> *) y, 65, table, work, isys);
  630.  
  631.  
  632.      Example 3:  With _X and _Y as in example 2, take the inverse FFT of Y and
  633.      store it back in _X. Note that the leading dimension of _X must be
  634.      increased to 2*_l_d_y. The scale factor 1.0/128.0 is used.  Assume that the
  635.      _T_A_B_L_E array is initialized already.
  636.  
  637.      Fortran:
  638.  
  639.            REAL    X(0:129, 0:55)
  640.            COMPLEX Y(0:64,  0:55)
  641.            ...
  642.            CALL CSFFTM(-1, 128, 50, 1.0/128.0, Y, 65, X, 130,
  643.           &            TABLE, WORK, ISYS)
  644.  
  645.  
  646.      C/C++:
  647.  
  648.           float x[56][130];
  649.           scsl_complex y[56][65];
  650.           csfftm(-1, 128, 50, 1.0f/128.0f, (scsl_complex *) y, 65,
  651.                 (float *) x, 130, table, work, isys);
  652.  
  653.  
  654.  
  655.  
  656.  
  657.                                                                        PPPPaaaaggggeeee 11110000
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))                                                          SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))
  665.  
  666.  
  667.  
  668.      C++ STL:
  669.  
  670.           float x[56][130];
  671.           complex<float> y[56][65];
  672.           csfftm(-1, 128, 50, 1.0f/128.0f, (complex<float> *) y, 65,
  673.                 (float *) x, 130, table, work, isys);
  674.  
  675.  
  676.      Example 4:  Perform the same computation as in example 2, but equivalence
  677.      the input and output arrays to save storage space.  In this case, a row
  678.      must be added to _X, because it is equivalenced to a complex array.  Use
  679.      the 8-byte integer version of SCSL.
  680.  
  681.      Fortran:
  682.  
  683.            REAL    X(0:129, 0:55)
  684.            COMPLEX Y(0:64,  0:55)
  685.            EQUIVALENCE ( X(0, 0), Y(0, 0) )
  686.            REAL    TABLE(128 + 256)
  687.            REAL    WORK(128+2)
  688.            INTEGER*8 ISYS(0:1)
  689.            ISYS(0) = 1_8
  690.            CALL SCFFTM(0_8, 128_8, 50_8, 1.0, X, 130_8, Y, 65_8,
  691.           &            TABLE, WORK, ISYS)
  692.            CALL SCFFTM(1_8, 128_8, 50_8, 1.0, X, 130_8, Y, 65_8,
  693.           &            TABLE, WORK, ISYS)
  694.  
  695.  
  696.      C/C++:
  697.  
  698.      #include <scsl_fft_i8.h>
  699.      float *x;
  700.      scsl_complex y[56][65];
  701.      float table[128 + 256];
  702.      float work[128+2];
  703.      long long isys[2];
  704.      isys[0] = 1LL;
  705.      x = (float *) &y[0][0];
  706.      scfftm(0LL, 128LL, 50LL, 1.0f, x, 130LL, (scsl_complex *) y, 65LL,
  707.            table, work, isys);
  708.      scfftm(1LL, 128LL, 50LL, 1.0f, x, 130LL, (scsl_complex *) y, 65LL,
  709.            table, work, isys);
  710.  
  711.  
  712.      C++ STL:
  713.  
  714.           #include <complex.h>
  715.           #include <scsl_fft_i8.h>
  716.           float *x;
  717.           complex<float> y[56][65];
  718.           float table[128 + 256];
  719.           float work[128+2];
  720.  
  721.  
  722.  
  723.                                                                        PPPPaaaaggggeeee 11111111
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))                                                          SSSSCCCCFFFFFFFFTTTTMMMM((((3333SSSS))))
  731.  
  732.  
  733.  
  734.           long long isys[2];
  735.           isys[0] = 1LL;
  736.           x = (float *) &y[0][0];
  737.           scfftm(0LL, 128LL, 50LL, 1.0f, x, 130LL,
  738.                 (complex<float> *) y, 65LL, table, work, isys);
  739.           scfftm(1LL, 128LL, 50LL, 1.0f, x, 130LL,
  740.                 (complex<float> *) y, 65LL, table, work, isys);
  741.  
  742.  
  743.      Example 5:  Perform the same computation as in example 2, but assume that
  744.      the lower bound of each Fortran array is 1, rather than 0.  No change is
  745.      made in the subroutine calls.
  746.  
  747.      Fortran:
  748.  
  749.      REAL    X(129, 56)
  750.      COMPLEX Y(65, 56)
  751.      CALL SCFFTM(0, 128, 50, 1.0, X, 129, Y, 65, TABLE, WORK,= ISYS)
  752.      CALL SCFFTM(1, 128, 50, 1.0, X, 129, Y, 65, TABLE, WORK, ISYS)
  753.  
  754.  
  755. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  756.      IIIINNNNTTTTRRRROOOO____FFFFFFFFTTTT(3S), IIIINNNNTTTTRRRROOOO____SSSSCCCCSSSSLLLL(3S), CCCCCCCCFFFFFFFFTTTT(3S), CCCCCCCCFFFFFFFFTTTTMMMM(3S), SSSSCCCCFFFFFFFFTTTT(3S)
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.                                                                        PPPPaaaaggggeeee 11112222
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.